Skip to content

chore: Add IgnoredInToolInputSchema annotation to ignore the parameter when generating the tool's input schema.#3067

Open
He-Pin wants to merge 1 commit intospring-projects:mainfrom
He-Pin:ignoreJsonSchema
Open

chore: Add IgnoredInToolInputSchema annotation to ignore the parameter when generating the tool's input schema.#3067
He-Pin wants to merge 1 commit intospring-projects:mainfrom
He-Pin:ignoreJsonSchema

Conversation

@He-Pin
Copy link
Contributor

@He-Pin He-Pin commented May 9, 2025

Motivation:

Ignore the parameter when generating the input schema.

instead of #3062

…al parameter when generating tool's input schema.

Signed-off-by: 虎鸣 <hepin.p@alibaba-inc.com>
@markpollack
Copy link
Member

Can you explain the motivation for this? If you don't want a method in your @tool annotated method to be used as an argument, it just shouldn't be there in the first place? At least that is how I'm reading this... Thanks

@markpollack markpollack added this to the 1.0.x milestone May 16, 2025
@He-Pin
Copy link
Contributor Author

He-Pin commented May 16, 2025

@markpollack Thanks for looking into this. We are adding TmcpContext to the call method, so we want to ignore that type to be generated as the input schema.

public interface TmcpToolCallback extends ToolCallback {

    /**
     * @param toolInput        the input to the tool
     * @param toolContext       tool context
     * @param tmcpInputContext tmcp input context
     */
    default String call(final String toolInput,
                        final @Nullable ToolContext toolContext,
                        final TmcpInputContext tmcpInputContext) {
        if (tmcpInputContext != null && !tmcpInputContext.getContext().isEmpty()) {
            throw new UnsupportedOperationException("tmcp context is not supported!");
        }
        return call(toolInput, toolContext);
    }
}

@markpollack markpollack removed this from the 1.1.0.M1 milestone Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments